package com.hfkz.project.serivce;

import java.util.List;

import com.hfkz.project.db.JDBCHelper;
import com.hfkz.project.domain.Book;
import com.hfkz.project.domain.Client;

public class ClientService {
	
	public List clientQuery(){
		String sql = "select client_id,client_name,client_register_time from t_client";
		List<Book> c = JDBCHelper.queryBySql(Client.class, 3, sql, new Object[]{});
		return c;
	}
	
	public List clientQuery(String clientName){
		String sql = "select client_id,client_name,client_register_time from t_client where client_name=?";
		List<Book> c = JDBCHelper.queryBySql(Client.class, 3, sql, new Object[]{clientName});
		return c;
	}
	
	public void insert(Client client){
		String sql ="insert into t_client (client_account,client_pwd,client_name,client_register_time,client_balance) values(?,?,?,?,?)";
		boolean flag = JDBCHelper.execute(sql, new Object[]{client.getAccount(),client.getPwd(),client.getClientName(),client.getRegisterTime(),client.getBalance()});
	}
}